package com.ysd.lis.controller;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.WkFolder;
import com.ysd.lis.request.WkFolderParam;
import com.ysd.lis.service.WkFolderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工表
 * 前端控制器
 * </p>
 *
 * @author peng
 * @since 2024-03-04
 */
@Api(tags = "文件管理-文件夹")
@RestController
@RequestMapping("/api/wk/wkFolder")
public class WkFolderController extends BaseController {

    @Autowired
    WkFolderService wkFolderService;
    @ApiOperation("查询")
    @GetMapping("/findFolderList")
    public Result findFolderList(WkFolderParam param){
        return wkFolderService.findFolderList(param);
    }
    @ApiOperation("查询")
    @GetMapping("/findFolderTreeByFolderCode")
    public Result findFolderTreeByFolderCode(WkFolderParam param){
        return wkFolderService.findFolderTreeByFolderCode(param);
    }

    @ApiOperation("通过编码查询文件夹树结构")
    @GetMapping("/findFolderTreeByCode")
    public Result findFolderTreeByCode(WkFolderParam param){
        return wkFolderService.findFolderTreeByCode(param);
    }
    @ApiOperation("通过编码查询文件")
    @GetMapping("/findFolderListByCode")
    public Result findFolderListByCode(WkFolderParam param){
        return wkFolderService.findFolderListByCode(param);
    }

    @ApiOperation("新增")
    @PostMapping("/addFolder")
    public Result addFolder(@RequestBody WkFolder folder){
        return  wkFolderService.addFolder(folder);
    }

    @ApiOperation("修改")
    @PostMapping("/editFolder")
    public Result editFolder(@RequestBody WkFolder folder) {
        return wkFolderService.editFolder(folder);
    }
    @ApiOperation("根据详情id删除详情数据")
    @PostMapping("/deleteFolder")
    public Result deleteFolder(@RequestBody WkFolder folder) {
        return wkFolderService.deleteFolder(folder);
    }
}
